package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;

import java.io.Serializable;

/**
 * 扫码地址表
 */
@ApiModel(description = "扫码地址表")
@Entity
@Table(name = "qr_address")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class QrAddress implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 地址编码
     */
    @ApiModelProperty(value = "地址编码")
    @Column(name = "address_code")
    private String addressCode;

    /**
     * 详细地址
     */
    @ApiModelProperty(value = "详细地址")
    @Column(name = "detail_address")
    private String detailAddress;

    /**
     * 二维码url
     */
    @Size(max = 1000)
    @ApiModelProperty(value = "二维码url")
    @Column(name = "qr_url", length = 1000)
    private String qrUrl;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    @Column(name = "status")
    private Boolean status;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAddressCode() {
        return addressCode;
    }

    public QrAddress addressCode(String addressCode) {
        this.addressCode = addressCode;
        return this;
    }

    public void setAddressCode(String addressCode) {
        this.addressCode = addressCode;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public QrAddress detailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
        return this;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    public String getQrUrl() {
        return qrUrl;
    }

    public QrAddress qrUrl(String qrUrl) {
        this.qrUrl = qrUrl;
        return this;
    }

    public void setQrUrl(String qrUrl) {
        this.qrUrl = qrUrl;
    }

    public Boolean isStatus() {
        return status;
    }

    public QrAddress status(Boolean status) {
        this.status = status;
        return this;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof QrAddress)) {
            return false;
        }
        return id != null && id.equals(((QrAddress) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "QrAddress{" +
            "id=" + getId() +
            ", addressCode='" + getAddressCode() + "'" +
            ", detailAddress='" + getDetailAddress() + "'" +
            ", qrUrl='" + getQrUrl() + "'" +
            ", status='" + isStatus() + "'" +
            "}";
    }
}
